﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CanDoo.Core.Data;
using CanDoo.Data;
using CanDoo.Admin.Core.Models;

namespace CanDoo.Oil.Core.Models
{
    /// <summary>
    /// 实体类——APP升级
    /// </summary>
    [Serializable]
    [Description("APP升级")]
    public class AppUpdate :  EntityBase,ICreatedTime, IAudited
    {
        /// <summary>
        ///版本名称
        /// </summary>
        [Display(Name = "版本名称")]
        [Required, StringLength(200)]
        public override string Name { get; set; }

        /// <summary>
        ///强制升级
        /// </summary>
        [Display(Name = "强制升级")]
        [Required]
        public bool ForceUpdate { get; set; }

        /// <summary>
        ///操作系统
        /// </summary>
        [Display(Name = "操作系统")]
        [Required, StringLength(50)]
        public string OS { get; set; }

        /// <summary>
        ///版本logo
        /// </summary>
        [Display(Name = "版本logo")]
        [StringLength(200)]
        public string LogoPath { get; set; }

        /// <summary>
        ///类别
        /// </summary>
        [Display(Name = "类别")]
        [Required, StringLength(50)]
        public string AppType { get; set; }

        /// <summary>
        ///版本号
        /// </summary>
        [Display(Name = "版本号")]
        [Required, StringLength(50)]
        public string Version { get; set; }

        /// <summary>
        ///下载地址
        /// </summary>
        [Display(Name = "下载地址")]
        [Required, StringLength(200)]
        public string FilePath { get; set; }

        /// <summary>
        ///文件大小
        /// </summary>
        [Display(Name = "文件大小")]
        [Required]
        public double Size { get; set; }

        /// <summary>
        ///MD5
        /// </summary>
        [Display(Name = "MD5")]
        [Required, StringLength(50)]
        public string MD5 { get; set; }

        /// <summary>
        ///版本描述信息
        /// </summary>
        [Display(Name = "版本描述信息")]
        [StringLength(200)]
        public string Remark { get; set; }

        
        #region Implementation of ICreatedTime

        /// <summary>
        /// 获取设置 信息创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        public DateTime CreatedTime { get; set; }
        #endregion

        #region Implementation of ICreatedAudited

        /// <summary>
        /// 获取或设置 创建者编号
        /// </summary>
        [Display(Name = "创建人")]
        public string CreatorUserId { get; set; }

        #endregion

        #region Implementation of IUpdateAutited

        /// <summary>
        /// 获取或设置 最后更新时间
        /// </summary>
        [Display(Name = "最后更新时间")]
        public DateTime? LastUpdatedTime { get; set; }

        /// <summary>
        /// 获取或设置 最后更新者编号
        /// </summary>
        [Display(Name = "最后更新用户")]
        public string LastUpdatorUserId { get; set; }

        #endregion
    }
}
